# Operating system (build VM template)
os: Visual Studio 2017

platform:
#    x64
    - Win32
#configuration: Release

# enable rdp
#init:
#  - ps: iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1'))

#on_finish:
#  - ps: $blockRdp = $true; iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1'))

environment:
    BOOST_ROOT: "C:\\Libraries\\boost_1_69_0"
    PY_SCRIPTS: "C:\\Python38-x64\\Scripts"


before_build:
    # boost
    - cmake --version
    - echo %BOOST_ROOT%
    - dir "C:\Libraries"
    - dir "%BOOST_ROOT%"
    - set PATH=%BOOST_ROOT%\lib64-msvc-14.1;%PY_SCRIPTS%;%PATH%
    - echo %PATH%

build_script:
  - py -m pip install conan
  - conan create conanfile.py rotor/0.20@
  - cmake -G "Visual Studio 15 2017 Win64" -H. -B_build-shared -DBOOST_ROOT="%BOOST_ROOT%" -DBUILD_SHARED_LIBS=on  -DBUILD_EXAMPLES=on -DBUILD_THREAD=on -DBUILD_BOOST_ASIO=on -DBoost_USE_STATIC_LIBS=on -DBoost_USE_MULTITHREADED=on
  - cmake --build _build-shared
  - cmake -G "Visual Studio 15 2017 Win64" -H. -B_build-static -DBOOST_ROOT="%BOOST_ROOT%" -DBUILD_SHARED_LIBS=off -DBUILD_EXAMPLES=on -DBUILD_THREAD=on -DBUILD_BOOST_ASIO=on -DBoost_USE_STATIC_LIBS=on -DBoost_USE_MULTITHREADED=on
  - cmake --build _build-static
test_script:
  - ps: cd "_build-static\tests"
  - ctest --timeout=5 -VV -C "%CONFIG%"
  - ps: cd "..\.."
  - ps: Get-ChildItem _build-shared\Debug -Recurse -filter *.dll | Copy -Destination _build-shared\tests\Debug
  - ps: cd "_build-shared\tests"
  - ctest --timeout=5 -VV -C "%CONFIG%"

